package cn.signalpha.modules.shop.entity;

import cn.signalpha.core.swagger.ApiModelPropertyEnum;
import cn.signalpha.modules.shop.entity.enums.CouponUseTypeEnum;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 实体类
 *
 * @author signalpha
 */
@Data
@TableName("shop_order_coupon")
@ApiModel(value = "OrderCoupon对象", description = "订单优惠券")
public class OrderCoupon implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
	@TableId(value = "id", type = IdType.ASSIGN_ID)
	@JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @ApiModelProperty(value = "订单号")
    private String orderNo;

    @ApiModelProperty(value = "优惠券id")
    private Long couponId;

    @ApiModelProperty(value = "优惠券领取id")
    private Long couponUserId;

	@ApiModelProperty(value = "优惠券使用类型")
	@ApiModelPropertyEnum(CouponUseTypeEnum.class)
	private Integer couponUseType;

	@ApiModelProperty(value = "命中的商品id")
	private String targetKey;

    @ApiModelProperty(value = "优惠券详情")
    private String couponInfo;

    @ApiModelProperty(value = "使用时间")
    private Date createTime;

}
